<template>
        <div class="demo-input-suffix">
        <el-select v-model="value" placeholder="请选择" @change="towerChange">
          <el-option
            v-for="item in options"
            :key="item.id"
            :label="item.roleName"
            :value="item.id">
          </el-option>
        </el-select>
         <el-button icon="el-icon-plus"  class="save" @click="addProductHandle"  type="primary">添加</el-button>
      </div>

</template>

<script>
import api from '../../../api'
export default {
  data(){
    return {
        options:[],
        value:"--全部--"
    }
  },
  mounted () {
    api.sysRolefindByAll().then(res=>{
      if(res.data.code == 2001){
         this.options= res.data.data
      }
    }).catch(err=>{
      console.log(err)

    })
  },
  methods: {
    addProductHandle(){
        this.$bus.$emit("onAddPersonShow",true)
    },
    towerChange(type) {
      this.$emit("onRefreshPersonChange",type)
    }
  }

}
</script>

<style scoped>
.demo-input-suffix{
  
   margin-top: 20px;
   text-align: left;
}
.select{
  margin-left: 10px;
}

.save{
   margin-left: 10px;
   border: none;
   border: 2px solid #409EFF;
   background-color: white;
   color: #409EFF;

}
</style>